﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 工业设备监控系统.configure
{
    public partial class UpdateData : Form
    {
        private int MainId;

        public string Name = string.Empty;
        public string Description;

        // 通信类型：TCP / Rtu
        public string CommunicationType;

        // TCP 用
        public string IpAddress;

        public int Port;

        // 串口用
        public string PortName;

        public int BaudRate;

        // 运行状态
        public string Status;

        public bool IsEnabled;

        public UpdateData()
        {
            InitializeComponent();
        }

        public UpdateData(int id, string name, string description, string communicationType, string ipAddress, int port, string portName, int baudRate, string status, bool isEnabled)
        {
            InitializeComponent();
            MainId = id;
            Name = name;
            Description = description;
            CommunicationType = communicationType;
            IpAddress = ipAddress;
            Port = port;
            PortName = portName;
            BaudRate = baudRate;
            Status = status;
            IsEnabled = isEnabled;

            this.txt_ID.Text = id.ToString();
            this.txt_Name.Text = name.ToString();
            this.txt_Desc.Text = description;
            this.txt_commutype.Text = communicationType;
            this.txt_ipaddress.Text = ipAddress;
            this.txt_port.Text = port.ToString();
            this.txt_portname.Text = portName;
            this.txt_baudrate.Text = baudRate.ToString();
            this.txt_Status.Text = status;
            this.txt_Isenabled.Text = isEnabled.ToString();
        }

        private void btn_Update_Click(object sender, EventArgs e)
        {
        }
    }
}